<template>
    <div>
        <h3>新闻11111111111111111111111111
            1111111111111111111111111111111111111111111111111111111111
            11111111111111111111111111详情
        </h3>
        <comments :id="this.id"></comments>
    </div>
</template>

<script>
    import { Toast } from 'mint-ui'

    import comments from '../subcomponents/comments.vue'

    export default {
        data() {
            return {
                id: this.$route.params.id,
                newsDetail: {}
            }
        },
        created() {
            this.getNewsDetail();
        },
        methods: {
            getNewsDetail(){
                this.$http.get('api/getnew/' + this.id).then(rets => {
                    if (rets.body.status === 0) {
                        this.newsDetail = rets.body.message[0]
                    } else {
                        Toast('failed to getNewsDetail')
                    }
                })
            }
        },
        components: {
            'comments': comments
        }
    }
</script>

<style lang="scss" scoped>

</style>